<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <link rel="stylesheet" href="/Public/css/bootstrap.min.css">
  <link rel="stylesheet" href="/Public/css/flat-ui.min.css">
  <link rel="stylesheet" href="/Public/css/wangEditor.min.css">
  <link rel="stylesheet" href="/Public/css/admin.css" charset="utf-8">
  <title>随遇而安blog</title>
</head>
<body>
  <div class="navbar navbar-default  header" role="navigation">
    <div class="container">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
          <span class="sr-only">Toggle navigation</span>
        </button>
        <a class="navbar-brand" href="<?php echo U('Home/Index/index');?>" target="_blank">随遇而安Blog</a>
      </div>
      <div class="navbar-collapse collapse">
        <ul class="nav navbar-nav">
          <li><a href="">首页</a></li>
          <li><a href="<?php echo U('Article/index');?>">文章管理</a></li>
          <li><a href="<?php echo U('Article/category');?>">分类管理</a></li>
          <li><a href="<?php echo U('Works/index');?>">作品管理</a></li>
        </ul>
      </div><!--/.nav-collapse -->
    </div>
</div>

    <div class="container content">
      <div class="panel panel-default">
      <!-- Default panel contents -->
      <div class="panel-heading">作品列表 <a href="<?php echo U('Works/edit');?>">添加作品</a></div>

      <!-- Table -->
      <table class="table">
        <thead>
          <tr>
            <th>id</th>
            <th>作品标题</th>
            <th>完成时间</th>
            <th>操作</th>
          </tr>
        </thead>
        <tbody>
          <?php if(is_array($works)): foreach($works as $key=>$v): ?><tr>
              <th scope="row"><?php echo ($v["id"]); ?></th>
              <td><?php echo ($v["title"]); ?></td>
              <td><?php echo ($v["time"]); ?></td>
              <td>
                <a class="btn btn-success btn-xs update" cid="<?php echo ($v["id"]); ?>" data-toggle="modal" data-target=".bs-update-modal-lg">修改</a>
                <a href="<?php echo U('Works/delWork',array('id'=>$v['id']));?>" class="btn btn-danger btn-xs">删除</a>
              </td>
            </tr><?php endforeach; endif; ?>
        </tbody>
      </table>
    </div>
    </div>
<footer class="container-full">

</footer>
<script src="/Public/js/vendor/jquery.min.js" charset="utf-8"></script>
<script src="/Public/js/flat-ui.min.js" charset="utf-8"></script>
<script src="/Public/js/app.js" charset="utf-8"></script>

</body>
</html>